package org.goyo.main.domain.entity.storage;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.goyo.main.domain.entity.BaseEntryObject;
import org.goyo.main.domain.entity.base.BaseUnitMeasure;
import org.goyo.main.domain.entity.base.Material;
/**
 * 库存盘点分录
 * 
 * @author chenchuan
 * 2014年11月12日
 */
@Entity
public class InventoryCheckEntry extends BaseEntryObject implements Serializable {

	private static final long serialVersionUID = 1L;
	@ManyToOne
	@JoinColumn(name="materialId")
	private Material material;
	/**
	 * 商品名称	
	 */
	@Column
	private String materialName;
	/**
	 * 商品规格型号	
	 */
	@Column
	private String materialStandard;
	/**
	 * 计量单位	
	 */
	@ManyToOne
	@JoinColumn(name="jilUnitId")
	private BaseUnitMeasure jilUnit;
	/**
	 * 账面数量	
	 */
	@Column
	private double paperQty = 0;
	/**
	 * 实盘数量	
	 */
	@Column
	private double actualQty = 0;
	/**
	 * 差异数量	
	 */
	@Column
	private double differenceQty = 0;
	/**
	 * 差异处理方式	
	 */
	@Column
	private String differenceWay;
	public String getMaterialName() {
		return materialName;
	}
	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}
	public String getMaterialStandard() {
		return materialStandard;
	}
	public void setMaterialStandard(String materialStandard) {
		this.materialStandard = materialStandard;
	}
	public String getDifferenceWay() {
		return differenceWay;
	}
	public void setDifferenceWay(String differenceWay) {
		this.differenceWay = differenceWay;
	}
	public Material getMaterial() {
		return material;
	}
	public void setMaterial(Material material) {
		if(material != null &&("".equals(material.getUuid()) || material.getUuid()==null))
			this.material = null;
		else
			this.material = material;	
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public BaseUnitMeasure getJilUnit() {
		return jilUnit;
	}
	public void setJilUnit(BaseUnitMeasure jilUnit) {
		if(jilUnit != null &&("".equals(jilUnit.getUuid()) || jilUnit.getUuid()==null))
			this.jilUnit = null;
		else
			this.jilUnit = jilUnit;	
	}
	public double getPaperQty() {
		return paperQty;
	}
	public void setPaperQty(double paperQty) {
		this.paperQty = paperQty;
	}
	public double getActualQty() {
		return actualQty;
	}
	public void setActualQty(double actualQty) {
		this.actualQty = actualQty;
	}
	public double getDifferenceQty() {
		return differenceQty;
	}
	public void setDifferenceQty(double differenceQty) {
		this.differenceQty = differenceQty;
	}
}
